Skip to content

fix: WordPress.org review — widgets through the widget registry; connected services by setting name, no value read (0.8.4) - #71

Merged
ABB65 merged 2 commits into
mainfrom
fix/wporg-registered-widgets
Oct 28, 2026
Merged

ABB65 merged 2 commits into
mainfrom
fix/wporg-registered-widgets

Conversation

@ABB65

@ABB65 ABB65 commented Oct 28, 2026

Copy link
Copy Markdown
Member

WordPress.org review (abb65, round 4) flagged includes/class-contentrain-bridge-coverage.php:160: get_option( $name ) on option names enumerated from the database. This PR removes every such read in the plugin, not only the flagged line.

What changes

  • Widgets (coverage + text scan): Text::widgets() lists $wp_widget_factory->widgets; each WP_Widget::get_settings() reads its own option. A widget whose plugin is inactive is no longer counted or scanned (WordPress does not show it either). recent-comments stays excluded from the text scan by id_base.
  • Integrations: the options query returns option_value <> '' AS has_value; secret_present = credential-named option that is not empty. No option value is read. Form links: CF7 integration present → credential; WPForms provider with an account entry → credential.
  • Evidence detail is the option name (mc4wp), not the keys inside it (mc4wp (api_key)). Migrate only forwards secret_present; nothing reads the detail.

Supersedes / removes

  • Text::widget_options() and its widget\_% SQL query (replaced by Text::widgets()).
  • The widget\_% SQL query in coverage.
  • Integrations::secret_keys() with its unserialize (no caller left).

Checks (local, clean WordPress container, WP_DEBUG on)

  • KEEP=1 npm run test:wordpress pass
  • test:text 74, test:coverage 79 + 76 + 13 RawIR, test:integrations 27, test:secrets pass
  • Plugin Check 2.1.0: 0 errors, 0 warnings
  • After the change, git grep 'get_option( \$' includes only shows reads bounded by fixed names in code.

Version 0.8.4 (plugin header, constant, Stable tag, changelog).

🤖 Generated with Claude Code

https://claude.ai/code/session_0184na12xBsMwvjYqcX5LKJv

ABB65 and others added 2 commits October 28, 2026 08:12
…ected services by setting name, no value read (0.8.4)

Coverage and the text scan listed every widget_* option name from the
database and read each one; both now ask $wp_widget_factory, and each
registered widget reads its own settings. Text::widget_options() and its
SQL query are removed.

Integrations no longer reads option values to tell whether a credential
is set: the database answers whether a credential-named option is empty.
Form links count an existing account entry. secret_keys() and its
unserialize are removed; evidence is the option name ("mc4wp").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0184na12xBsMwvjYqcX5LKJv
@ABB65
ABB65 merged commit 3a3d9d0 into main Oct 28, 2026
10 checks passed
@ABB65
ABB65 deleted the fix/wporg-registered-widgets branch October 28, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant